import Layout from "@/layouts";
import menuLayout from "@/menuLayout";

const noMenuRoutes = [
  {
    path: "/homepage",
    component: Layout,
    redirect: "/homepage",
    children: [
      {
        path: "/homepage",
        name: "homepage",
        component: () => import("../views/homepage/index.vue"),
        meta: {
          title: "首页",
          keepAlive: true
        }
      },

      {
        path: "/more",
        name: "more",
        component: () => import("../views/more/index.vue"),
        meta: {
          title: "更多",
          keepAlive: true
        }
      },
      {
        path: "/myWorld",
        name: "myWorld",
        component: () => import("../views/3D/myWorld/index.vue"),
        meta: {
          title: "3D世界",
          keepAlive: true
        }
      }
    ]
  }
];

const menuList = [
  {
    path: "/",
    component: menuLayout,
    redirect: "/home",
    meta: {
      title: "首页"
    },
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/home/index.vue"),
        meta: {
          title: "首页"
        }
      },
      {
        path: "/data",
        name: "data",
        component: () => import("../views/data/index.vue"),
        meta: {
          title: "x6自定义节点",
          keepAlive: true
        }
      },
      {
        path: "/more",
        name: "more",
        component: () => import("../views/more/index.vue"),
        meta: {
          title: "更多"
        }
      }
    ]
  },
  {
    path: "/myWorld",
    name: "myWorld",
    component: () => import("../views/3D/myWorld/index.vue"),
    meta: {
      title: "3D世界",
      keepAlive: true
    }
  },
  {
    path: "/code",
    component: menuLayout,
    redirect: "/lowCode",
    meta: {
      title: "低代码"
    },
    children: [
      {
        path: "/lowCode",
        name: "lowCode",
        component: () => import("../views/lowCode/index.vue"),
        meta: {
          title: "低代码"
        }
      }
    ]
  },
  {
    path: "/sys",
    component: menuLayout,
    redirect: "/dictionary",
    meta: {
      title: "系统设置"
    },
    children: [
      {
        path: "/dictionary",
        name: "dictionary",
        component: () => import("../views/sys/dictionary/index.vue"),
        meta: {
          title: "数据字典"
        }
      }
    ]
  }
];

export const routes = [...noMenuRoutes, ...menuList];

export const menuRoutes = menuList;
